package com.woniuxy.zqqtestnacos.controller;

import com.woniuxy.commons.entity.PageBean;
import com.woniuxy.commons.entity.Staff;
import com.woniuxy.commons.service.StaffService;
import com.woniuxy.commons.utils.ResponseResult;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author author
 * @create 2021-11-09 11:43
 */
@RestController
@RequestMapping("/zqqtestnacos")
public class TestController {
    @Value("${server.port}")
    private String port;

    @Resource
    private StaffService staffService;

    @RequestMapping("/test")
    public String test() {

        return port;
    }


    //测试fegin的方法
    @GetMapping("/get")
    public ResponseResult<PageBean<Staff>> getall() {
        Staff staff=new Staff();
//        staff.setUsername("zqq");
        ResponseResult<PageBean<Staff>> allStaff = staffService.getAllStaff(staff, 1, 5);

        return allStaff;
    }



}
